<template>
	<view class="overall">
		<view class="content">
			<view>{{newsInfo.title}}</view>
			<view>
				<view>阅读 {{newsInfo.num}}人</view>
				<view>{{newsInfo.create_time}}</view>
			</view>
			<view>{{newsInfo.details}}</view>
		</view>
	</view>
</template>

<script lang="ts" setup>
	import { ref } from 'vue';
	import { editTrends } from '@/api/index.js';

	function handleClickLeft() {
		uni.navigateBack();
	}
	const newsInfo = ref([]);

	uni.getStorage({
		key: 'news',
		success: function (res) {
			console.log(res.data); // 输出存储的数据对象
			newsInfo.value = res.data;
			editTrends({
				id: res.data.id,
				num: res.data.num,
			}).then(res => {
				console.log(res);
			})
		}
	});
</script>

<style scoped>
	.overall {
		width: 100%;
		background-color: #FFFFFF;
		min-height: 150vh;
	}

	.title {
		width: 100%;
		height: 180rpx;
		background-color: #00DACA;
		color: white;
		display: flex;
		align-items: center;
		position: fixed;
		top: 0;
	}

	.name {
		display: flex;
		align-items: center;
		font-weight: bold;
		font-size: 42rpx;
		margin-top: 50rpx;
		margin-left: 3%;
	}

	.name>view {
		margin-left: 20rpx;
	}

	.content {
		margin-top: 0rpx;
		width: 94%;
		padding: 30rpx 3%;
	}

	.content>view:first-child {
		font-weight: bold;
		font-size: 32rpx;
	}

	.content>view:nth-child(2) {
		display: flex;
		justify-content: space-between;
		margin: 30rpx 0;
		color: #A6A6A6;
	}

	.content>view:nth-child(3) {
		font-size: 30rpx;
	}

	.content>image {
		width: 100%;
		height: 250rpx;
		object-fit: cover;
		margin-bottom: 200rpx;
	}
</style>